package gxprod.androidai;

import android.graphics.Color;
import android.view.Gravity;

/**
 * A Bubble represents a short block of text or a widget that should be displayed on the screen.
 * This probably won't change
 * @author Josh Maleszewski
 */
public class Bubble {

	public Object widgetData;
	public String text;
	public BubbleType type;
	public boolean isTemp = false;
	
	public Bubble(String text, BubbleType type) {
		this.text = text;
		this.type = type; 
	}

	public Bubble(String text) {
		this.text = text;
		this.type = BubbleType.response;
	}

	public Bubble(String text, Object data) {
		this.type = BubbleType.widget;
		this.text = text;
		widgetData = data;
	}

	public int getGravity() {
		switch(type) {

			case input:
				return Gravity.RIGHT;
			case question:
			case widget:
				return Gravity.CENTER_HORIZONTAL;

			case response:
			default:
				return Gravity.LEFT;
		}
	}

	public enum BubbleType {
		input		("#408dd2", "#052645"), 
		response	("#a3bece", "#1D2529"),
		question	("#101010", "#FFF273"),
		widget		("#bbbbbb", "#292929");

		public int PrimColor, SecColor;

		BubbleType(String prim, String sec) {
			PrimColor = Color.parseColor(prim);
			SecColor = Color.parseColor(sec);
		}
	}
}
